<%@ page language="java" import="java.util.*,
com.king.cms.db.QueryPage,
com.king.cms.orm.CmsUser,
com.king.cms.common.PowerParameter" pageEncoding="UTF-8"%>
<%@ include file="../../include/css.jsp"%>
<%-- /*包含css样式表*/ --%> 

<%
	String pageFunc = "帐号设置";	
	int pow=3 | PowerParameter.amend;
%>

<% 
QueryPage query=(QueryPage)request.getAttribute("query"); 
  List list=new ArrayList();
  if(request.getAttribute("list") != null)
     list=(List)request.getAttribute("list");
     Map map=new HashMap();
     if(request.getAttribute("map") != null)
       map = (Map)request.getAttribute("map");
     
%> 
<html>
	<head>
		<title><%=pageFunc%>
		</title>
		<meta  http-equiv="Expires"     CONTENT="0">           
<meta  http-equiv="Cache-Control"     CONTENT="no-cache">           
<meta  http-equiv="Pragma"     CONTENT="no-cache">
		<script language="javascript">
		var trKiobj;
		var usreid=null;
			function doEnable()
			{
				form1.bmMc.disabled=false;
				form1.bmBzrs.disabled=false;
			}
			function  ki_add()
			{
				window.open('<%=basePath%>user.do?doClass=accnewuser','_self');
			}
			function ki_del(){
				var objss = document.getElementsByName('usreid');
			    var checkIdss = 0; 
		         if(objss.length>0){
		            for(var i=0;i<objss.length;i++){
		                 if(objss[i].checked)
		                   checkIdss++;
		            }        
		         }
		         if(checkIdss == 0)
		           alert('请选择要删除的记录');
		         else 
			  if(confirm('确认删除所选帐号？')){
				form1.submit();
			  }
			}
			function ki_amend(){
			   var objs =   document.getElementsByName('usreid');
		         var checkIds = 0;
		         var id = '';
		         if(objs.length>0){
		            for(var i=0;i<objs.length;i++){
		                 if(objs[i].checked)
		                   checkIds++;
		            }        
		         }
		         if(checkIds >1){
		            alert('请选择一条记录进行修改');
		            return;
		         }
		         if(checkIds == 0){
		            alert('请选择	要修改的记录');
		            return;
		         }
		         if(checkIds == 1){
		           for(var i=0;i<objs.length;i++){
		                 if(objs[i].checked)
		                   id = objs[i].value;
		            }   
		         } 
			   if(id != '') 
                       window.open('<%=basePath%>user.do?doClass=accamend&usreid='+id,'_self');
				else alert('请选择用户！');
			}
			function selmm(trobj,id)
			{
			
				if(trobj != null){
					usreid =id;
					if(trKiobj != null)
					   trKiobj.className='td3';
				     trobj.className='td1';
				}
			 trKiobj=trobj;
			}
	 </script>
	</head>
	<body background="<%=imgpath%>top3.gif" leftmargin="0" topmargin="0">
		<center>
		<form name="form1" method="post"
			action="<%=basePath%>user.do?doClass=accdel">
			<table border="0" cellpadding="0" cellspacing="0" width="98%"
				height="2">
				<tr>
					<td width="9" height="1"></td>
					<td height="1" background="<%=path%>/img/images_06.gif">
						<p align="center">
							<b><%=pageFunc%>
							</b>
					</td>
					<td width="9" height="1"></td>
				</tr>
			</table>
			<table  border="0" cellpadding="2" cellspacing="1"
				class="bg_table" style="width:90%" bordercolor="#111111">
				<tr class="top_td" >
					<td width="10%">序号</td>
					<td>选择</td>
					<td>帐号</td>
					<td width="10%">姓名</td>
					<td width="10%">角色</td>
					<td width="10%">勾选角色</td>
                </tr>
                <% Iterator iterator=list.iterator(); 
                	int i=1;
                  while(iterator.hasNext()){
                  CmsUser cmsUser=(CmsUser)iterator.next();
                 
                %>
                <tr <%if(i%2==1){%> class="td2" onMouseOver="this.className='td5'" onMouseOut="this.className='td2'"<%} else {%>class="td3" onMouseOver="this.className='td5'" onMouseOut="this.className='td3'" <%}%> onclick="selmm(this,<%if(cmsUser.getId() != null) out.print(cmsUser.getId()); %>)">
					<td  width="10%"><%=(query.getCurrentPageNo()-1)*10+i %></td>
					<td  width="10%"><%if(cmsUser.getId().intValue() !=12) {%><input name="usreid" type="checkbox" value="<%=cmsUser.getId() %>" /><%}else{ %>&nbsp;<%} %></td>
				<td><%=cmsUser.getUid() %></td>
				<td><%=cmsUser.getUserName() %></td>
				<td>&nbsp;<%if(map.get(cmsUser.getRoleId()) != null)out.println(map.get(cmsUser.getRoleId())); %></td>
				<td><a href="<%=basePath%>user.do?doClass=userrole&usreid=<%=cmsUser.getId()%>"><font color="red">选择</font></a></td>
                </tr>
                <% i++;} %>
				<tr class="top_td">
					<td colspan="7">
						<%=query.getPageStr()%>
					</td>
				</tr>
			</table>
</form>
</center>
		</body>
</html>
<%@ include file="../../pow.jsp"%>
